﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Microsoft.VisualBasic;
using Innvoice.Logica.GestorDB;

namespace Innvoice.Ws.Paises
{
    /// <summary>
    /// Lógica de interacción para Paises.xaml
    /// </summary>
    public partial class Paises : Window
    {
        public Paises()
        {
            InitializeComponent();

            // seteo window
            this.Height = 350;

            // seteo pais
            PaisDB misPaises = new PaisDB();
            lbxPais.ItemsSource = misPaises.obtenerPaises();
        }


        private void Window_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.Key.ToString().ToUpper())
            {
                case "ESCAPE":
                    this.Close();
                    break;
                default:
                    return;
            }
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {

        }

        private void btnNuevo_Click(object sender, RoutedEventArgs e)
        {
            string mpais = Interaction.InputBox("Ingrese el nombre del pais","Pais?","",10,10);
            while (string.IsNullOrWhiteSpace(mpais))
            {
                 mpais = Interaction.InputBox("Ingrese el nombre del pais", "Pais?","",10,10);
            }
        }

        private void btnVolver_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }


    }
}
